package net.maxwoods.filter;

import net.maxwoods.config.RootConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;

import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import java.util.Set;

public class MyInit implements ServletContainerInitializer {
    
    private static final Logger logger= LoggerFactory.getLogger(MyInit.class);

    @Override
    public void onStartup(Set<Class<?>> c, ServletContext ctx) throws ServletException {
        ctx.setInitParameter("contextClass", AnnotationConfigWebApplicationContext.class.getName());
        ctx.setInitParameter("contextConfigLocation", RootConfig.class.getName());
        logger.warn("spring 初始化:{}",getClass().getName());
    }
}
